<?php
require_once("../Spac/model/Auth.Class.php");
require_once("../Spac/model/Customer.Class.php");
class Company extends Controller {

	//this class access controll ('allow' or 'deny')
	var $MethodAccessControlType	= 'allow';

	//Methods access controll in this class
	var $AccessMethods		= array(
									'execute','aboutCompany','aboutBusiness','aboutProduct',		
									'usersGuide','privacyPolicy','siteMap','map','denyEmailCollector'
	);

	var $Auth;
	var $Customer;
	
	function Company() {

		$this->initController();

		$this->getControllerInstance("Dao");
		$this->Dao->Connect();

		//Auth, Customer 에 Dao 를 전달하여 인스턴스 생성
		$this->Auth			= new Auth($this->Dao);			
		$this->Customer		= new Customer($this->Dao);

		$this->setLayout("sub");			//기본레이아웃 셋

	}

	//-- 기본
	function execute() {
		$this->viewMain();
	}


	//-- 메인 페이지
	function viewMain() {
		$this->setLayout("main");			//메인에선만 메인레이아웃 사용

		//최근공지사항 가져오기
		$this->recent_bbs			= $this->Customer->getRecentData('notice',5);


		$this->result_uri = "/main_contents.html";
		$this->dispatcher();
	}





	//-- 서브/회사소개 페이지
	function aboutCompany() {

		$this->sub_dir		= "/company";		//회사소개페이지는 company 디렉토리에 작성

		$this->chapter		= $this->args[0];	//전달받는 첫번째인자를 하위메뉴로 사용한다.

		//-- layout set
//		$this->setLayout("sub");
		$this->layout['left']	= $this->sub_dir."/left.html";

		//-- body set
		$this->result_uri							= $this->sub_dir."/welcome.html";								//-- 기본페이지
		if($this->chapter == 'welcome')				$this->result_uri = $this->sub_dir."/welcome.html";
		if($this->chapter == 'about_company')		$this->result_uri = $this->sub_dir."/about_company.html";
		if($this->chapter == 'history')				$this->result_uri = $this->sub_dir."/history.html";
		if($this->chapter == 'organization')		$this->result_uri = $this->sub_dir."/organization.html";
		if($this->chapter == 'map')					$this->result_uri = $this->sub_dir."/map.html";		
		
		$this->dispatcher();

	}


        


	//-- 서브/사업안내 페이지
	function aboutBusiness() {

		$this->sub_dir		= "/business";		//회사소개페이지는 company 디렉토리에 작성

		$this->chapter		= $this->args[0];	//전달받는 첫번째인자를 하위메뉴로 사용한다.

		//-- layout set
//		$this->setLayout("sub");
		$this->layout['left']	= $this->sub_dir."/left.html";

		//-- body set
		$this->result_uri							= $this->sub_dir."/business1.html";								//-- 기본페이지
		if($this->chapter == 'business1')			$this->result_uri = $this->sub_dir."/business1.html";
		if($this->chapter == 'business2')			$this->result_uri = $this->sub_dir."/business2.html";
		if($this->chapter == 'business3')			$this->result_uri = $this->sub_dir."/business3.html";
		
		$this->dispatcher();
		
	}


	function aboutProduct() {


		$this->sub_dir		= "/product";		//회사소개페이지는 company 디렉토리에 작성

		$this->chapter		= $this->args[0];	//전달받는 첫번째인자를 하위메뉴로 사용한다.

		//-- layout set
//		$this->setLayout("sub");
		$this->layout['left']	= $this->sub_dir."/left.html";

		//-- body set
		$this->result_uri							= $this->sub_dir."/product1.html";								//-- 기본페이지
		if($this->chapter == 'product1')			$this->result_uri = $this->sub_dir."/product1.html";
		if($this->chapter == 'product2')			$this->result_uri = $this->sub_dir."/product2.html";
		if($this->chapter == 'product3')			$this->result_uri = $this->sub_dir."/product3.html";
		
		$this->dispatcher();
		

	}

	function usersGuide() {
		$this->result_uri		= "/users_guide/users_guide.html";
		$this->dispatcher();		
	}

	function privacyPolicy() {
		$this->result_uri		= "/users_guide/privacy_policy.html";
		$this->dispatcher();		
	}

	function siteMap() {
		$this->result_uri		= "/users_guide/site_map.html";
		$this->dispatcher();		
	}

	function denyEmailCollector() {
		$this->result_uri		= "/users_guide/deny_email_collector.html";
		$this->dispatcher();		
	}





	
}
?>

